import React from "react";
import { useRedux } from "../../hooks/useRedux";
export const Home = () => {
  const { state, actions } = useRedux();
  return (
    <div>
      <button
        onClick={() => {
          actions.global.reduceCount();
        }}
      >
        减少
      </button>
      {state.count}
      <button
        onClick={() => {
          actions.global.addCount();
        }}
      >
        增加
      </button>
      <button
        onClick={() => {
          actions.global.changeLoading(!state.loading);
        }}
      >
        {state.loading ? "停止" : "开始"}
      </button>
    </div>
  );
};
